import Vue from "vue";
import config from "../config";
let designWidth = config.fontSize; //因设计图的宽度
let that = this;
//窗体改变大小触发事件
uni.onWindowResize(res => {
  console.log("变化后的窗口宽度=", res.size.windowWidth);
  //100*屏幕宽度/设计稿宽度
  Vue.prototype.$fontsize = Math.floor((1.5 * res.size.windowWidth) / designWidth) + "px";
  console.log("字体大小：", that.fontsize);
});

//打开获取屏幕大小
uni.getSystemInfo({
  success(res) {
    console.log("设备信息：", res);
    Vue.prototype.$fontsize = Math.floor((1.5 * res.screenWidth) / designWidth) + "px";
    console.log("字体大小：", that.fontsize);
  },
});
